import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/home.vue'
import Phone from '../views/phone.vue'
import Shop from '../views/shop.vue'
import User from '../views/user.vue'

import Era from "@/views/er/era.vue"
import Erc from "@/views/er/erc.vue"

Vue.use(VueRouter)

const routes = [
  {
    path: '/home',
    name: 'Home',
    component: Home,
      children:[
        {
          path: '/era',
          name: 'Era',
          component: Era
        },
        {
          path: 'erc',
          name: 'Erc',
          component: Erc
        }
      ]
  },
  {
    path: '/phone',
    name: 'Phone',
    component: Phone
  },
  {
    path: '/shop',
    name: 'Shop',
    component: Shop
  },
  {
    path: '/user',
    name: 'User',
    component: User
  },
  {
    path:"/",
    redirect:"/home"
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
